home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01lab1.zip / SIMLATRS / AUTO.SPC < prev    next >
Text File  |  1992-11-11  |  4KB  |  117 lines

  1. -- *******************************************
  2. -- *                                         *
  3. -- *  Automobile_Interface                   *  SPEC
  4. -- *                                         *
  5. -- *******************************************
  6. package Automobile_Interface is
  7.  
  8.   Maximum_Speed : constant := 120.0;
  9.   type SPEED is new FLOAT
  10.       range 0.0 .. Maximum_Speed;  -- MPH
  11.  
  12.   -- ...........................................
  13.   -- .                                         .
  14.   -- .  Automobile_Interface.Turn_On_Engine    .  SPEC
  15.   -- .                                         .
  16.   -- ...........................................
  17.   procedure Turn_On_Engine;
  18.   --| Purpose
  19.   --|    Turn on the automobile engine.  The Brake
  20.   --| Pedal and Accelerator Pedal routines are
  21.   --| activated.
  22.  
  23.   -- ...........................................
  24.   -- .                                         .
  25.   -- .  Automobile_Interface.Turn_Off_Engine   .  SPEC
  26.   -- .                                         .
  27.   -- ...........................................
  28.   procedure Turn_Off_Engine;
  29.   --| Purpose
  30.   --|    Turn off the automobile engine.  The Brake
  31.   --| Pedal and Accelerator Pedal routines are
  32.   --| deactivated and the car comes to a stop.
  33.  
  34.   -- ....................................................
  35.   -- .                                                  .
  36.   -- .  Automobile_Interface.Depress_Accelerator_Pedal  .  SPEC
  37.   -- .                                                  .
  38.   -- ....................................................
  39.   procedure Depress_Accelerator_Pedal;
  40.   --| Purpose
  41.   --|    The car accelerates.
  42.   --|
  43.   --| Notes
  44.   --|    Turn_On_Engine must first be called.
  45.  
  46.   -- ....................................................
  47.   -- .                                                  .
  48.   -- .  Automobile_Interface.Hold_Accelerator_Pedal     .  SPEC
  49.   -- .                                                  .
  50.   -- ....................................................
  51.   procedure Hold_Accelerator_Pedal;
  52.   --| Purpose
  53.   --|    The car stops accelerating and holds a steady speed.
  54.   --|
  55.   --| Notes
  56.   --|    Turn_On_Engine must first be called.
  57.  
  58.   -- ....................................................
  59.   -- .                                                  .
  60.   -- .  Automobile_Interface.Release_Accelerator_Pedal  .  SPEC
  61.   -- .                                                  .
  62.   -- ....................................................
  63.   procedure Release_Accelerator_Pedal;
  64.   --| Purpose
  65.   --|    The car stops accelerating and starts to
  66.   --| decelerate.
  67.   --|
  68.   --| Notes
  69.   --|    Turn_On_Engine must first be called.
  70.  
  71.   -- ..............................................
  72.   -- .                                            .
  73.   -- .  Automobile_Interface.Depress_Brake_Pedal  .  SPEC
  74.   -- .                                            .
  75.   -- ..............................................
  76.   procedure Depress_Brake_Pedal;
  77.   --| Purpose
  78.   --|    The car decelerates quickly.
  79.   --|
  80.   --| Notes
  81.   --|    Turn_On_Engine must first be called.
  82.  
  83.   -- ..............................................
  84.   -- .                                            .
  85.   -- .  Automobile_Interface.Release_Brake_Pedal  .  SPEC
  86.   -- .                                            .
  87.   -- ..............................................
  88.   procedure Release_Brake_Pedal;
  89.   --| Purpose
  90.   --|    The car decelerates at the same speed as
  91.   --| it does if Release_Accelerator_Pedal is called.
  92.   --|
  93.   --| Notes
  94.   --|    Turn_On_Engine must first be called.
  95.  
  96.   -- ...........................................
  97.   -- .                                         .
  98.   -- .  Automobile_Interface.Sensed_Speed      .  SPEC
  99.   -- .                                         .
  100.   -- ...........................................
  101.   function Sensed_Speed return SPEED;
  102.   --| Purpose
  103.   --|    Return the speed of the car.
  104.  
  105.   -- ...........................................
  106.   -- .                                         .
  107.   -- .  Automobile_Interface.Update            .  SPEC
  108.   -- .                                         .
  109.   -- ...........................................
  110.   procedure Update;
  111.   --| Purpose
  112.   --|    Update the status of the car.  This routine
  113.   --| should be called periodically, and it advances
  114.   --| the state of the car to the next second.
  115.  
  116. end Automobile_Interface;
  117.